package com.eshore.norm.pattern.combination;

import java.util.ArrayList;
import java.util.List;

/**
 * 菜单项，下级没有了
 *
 * @author: v-chenjl62
 * @date: 2024/2/5 17:42
 */
public class MenuItem extends MenuComponent{

    public MenuItem(String name,int level) {
        this.name=name;
        this.level=level;
    }

    @Override
    public void print() {
        for (int i = 0; i < this.level; i++) {
            System.out.print("--");
        }
        System.out.println(this.getName());
    }
}
